﻿using JetBrains.Annotations;
using System.Diagnostics;

namespace Aurora.Module.Extensions
{
    /// <summary>
    /// 检查扩展类
    /// </summary>
    [DebuggerStepThrough]
    public static class Check
    {
        [ContractAnnotation("value:null => halt")]
        public static T NotNull<T>(
       T? value,
       [InvokerParameterName][NotNull] string parameterName)
        {
            if (value == null)
            {
                throw new ArgumentNullException(parameterName);
            }

            return value;
        }

    }
}
